/**
@ description: erase the elements equal to N from vector
@ author: timlentse(tinglenxan@gmail.com)
@ Date: 2014-11-04
*/
#include <iostream>
#include <vector>

using namespace std;
int main (int argc, char* agrv[])
{
  vector<int> myVector;

  // set some values (from 1 to 10)
  for (int i=1; i<=10; i++) myVector.push_back(i);

  // erase the element which equals to n
  for (vector<int>::iterator iter = myVector.begin(); iter!=myVector.end(); ++iter){
       if (*iter == 5)
       myVector.erase(iter);
       }
  for (unsigned i=0; i<myVector.size(); ++i)
  cout << ' ' << myVector[i];
  cout << '\n';
  return 0;
  }